package com.jwx.mycar.service.impl;

import com.jwx.mycar.entity.po.Reply;
import com.jwx.mycar.mapper.ReplyMapper;
import com.jwx.mycar.service.ReplyService;
import com.jwx.mycar.utils.KeyUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description:
 * @author: jwx
 * @time: 2019/11/27 17:49
 */
@Service
public class ReplyServiceImpl implements ReplyService {
    @Autowired
    ReplyMapper replyMapper;

    public boolean add(Reply reply) {
        reply.setReplyId(KeyUtil.genUniqueKey());
        return replyMapper.add(reply);
    }

    @Override
    public boolean deleteById(String replyId) {
        return replyMapper.deleteById(replyId);
    }

    @Override
    public List<Reply> getAll(String draftId) {
        return replyMapper.getAll(draftId);
    }
}

